﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OS
{
    public class Frame
    {
        private char[] data;
        private int id;
        private int lastAccessed;

        public Frame()
        {
            data = new char[40];
            id = -1;
            lastAccessed = -1;
        }

        public Frame(int i)
        {
            data = new char[40];
            id = i;
            lastAccessed = -1;
        }

        public Frame(int d, char[]c)
        {
            char[] temp = new char[40];

            if (c.Length < 40)
            {
                for (int i = 0; i < c.Length; i++)
                {
                    temp[i] = c[i];
                }

                for (int i = c.Length; i < 40 - c.Length; i++)
                {
                    temp[i] = ' ';
                }

                data = temp;
            }
            else
            {
                data = c;
            }

            id = d;
            lastAccessed = -1;
        }

        public char[] Data
        {
            get { return data; }
            set { data = value; }
        }

        public int ID
        {
            get { return id; }
            set { id = value; }
        }

        public int LastAccessed
        {
            get { return lastAccessed; }
            set { lastAccessed = value; }
        }
    }
}
